package adapter;

/**
 * @author ycc
 * @date 2024/4/2
 */
public class MediaAdapter implements MediaPlayer {
    private String audioType;
    private String fileName;

    public MediaAdapter(String audioType, String fileName) {
        this.audioType = audioType;
        this.fileName = fileName;
    }

    @Override
    public void play(String audioType, String fileName) {
        if (audioType.equalsIgnoreCase("mp4") || audioType.equalsIgnoreCase("vlc")) {
            System.out.println("Playing " + audioType + " file. Name: " + fileName);
        } else {
            System.out.println("Invalid media. " + audioType + " format not supported");
        }
    }
}
